package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * 下发状态
 *
 * @program: wms
 * @description:
 * @author: leo
 * @create: 2020-10-10 10:21
 */
public enum IssueStatusEnum implements IEnum<Integer> {
    /**
     * 下发状态
     */
    NOT_ISSUED(0, "未下发"),
    ISSUED(1, "已下发");

    /**
     * 值
     */
    private final Integer value;

    /**
     * 描述
     */
    private final String desc;

    IssueStatusEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static final Map<Integer, IssueStatusEnum> ENUM_MAP = new HashMap();

    static {
        IssueStatusEnum[] values = values();
        int length = values.length;
        for (int i = 0; i < length; i++) {
            IssueStatusEnum value1 = values[i];
            ENUM_MAP.put(value1.getValue(), value1);
        }
    }


    public static IssueStatusEnum getEnumByValue(String value) {

        return ENUM_MAP.get(value);
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String toString() {
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
